package com.itheima.controller;

import com.itheima.entity.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@ControllerAdvice
public class BaseExceptionHandler {

      @ExceptionHandler
      @ResponseBody
      public Result error(Exception e){
          e.printStackTrace();
          System.out.println("驰哥NP");
          return  new Result(false,"处理失败");

      }
}
